\(\int \frac {\csc ^5(x)}{i+\tan (x)} \, dx\) [9]

   Optimal result
   Rubi [A] (verified)
   Mathematica [B] (verified)
   Maple [A] (verified)
   Fricas [B] (verification not implemented)
   Sympy [F]
   Maxima [B] (verification not implemented)
   Giac [B] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 13, antiderivative size = 40 \[ \int \frac {\csc ^5(x)}{i+\tan (x)} \, dx=-\frac {1}{8} i \text {arctanh}(\cos (x))-\frac {1}{8} i \cot (x) \csc (x)-\frac {\csc ^3(x)}{3}+\frac {1}{4} i \cot (x) \csc ^3(x) \]

[Out]

-1/8*I*arctanh(cos(x))-1/8*I*cot(x)*csc(x)-1/3*csc(x)^3+1/4*I*cot(x)*csc(x)^3

Rubi [A] (verified)

Time = 0.18 (sec) , antiderivative size = 40, normalized size of antiderivative = 1.00, number of steps used = 9, number of rules used = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.615, Rules used = {3599, 3187, 3186, 2686, 30, 2691, 3853, 3855} \[ \int \frac {\csc ^5(x)}{i+\tan (x)} \, dx=-\frac {1}{8} i \text {arctanh}(\cos (x))-\frac {\csc ^3(x)}{3}+\frac {1}{4} i \cot (x) \csc ^3(x)-\frac {1}{8} i \cot (x) \csc (x) \]

[In]

Int[Csc[x]^5/(I + Tan[x]),x]

[Out]

(-1/8*I)*ArcTanh[Cos[x]] - (I/8)*Cot[x]*Csc[x] - Csc[x]^3/3 + (I/4)*Cot[x]*Csc[x]^3

Rule 30

Int[(x_)^(m_.), x_Symbol] :> Simp[x^(m + 1)/(m + 1), x] /; FreeQ[m, x] && NeQ[m, -1]

Rule 2686

Int[((a_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((b_.)*tan[(e_.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Dist[a/f, Subst[
Int[(a*x)^(m - 1)*(-1 + x^2)^((n - 1)/2), x], x, Sec[e + f*x]], x] /; FreeQ[{a, e, f, m}, x] && IntegerQ[(n -
1)/2] &&  !(IntegerQ[m/2] && LtQ[0, m, n + 1])

Rule 2691

Int[((a_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Simp[b*(a*Sec[e +
 f*x])^m*((b*Tan[e + f*x])^(n - 1)/(f*(m + n - 1))), x] - Dist[b^2*((n - 1)/(m + n - 1)), Int[(a*Sec[e + f*x])
^m*(b*Tan[e + f*x])^(n - 2), x], x] /; FreeQ[{a, b, e, f, m}, x] && GtQ[n, 1] && NeQ[m + n - 1, 0] && Integers
Q[2*m, 2*n]

Rule 3186

Int[cos[(c_.) + (d_.)*(x_)]^(m_.)*sin[(c_.) + (d_.)*(x_)]^(n_.)*(cos[(c_.) + (d_.)*(x_)]*(a_.) + (b_.)*sin[(c_
.) + (d_.)*(x_)])^(p_.), x_Symbol] :> Int[ExpandTrig[cos[c + d*x]^m*sin[c + d*x]^n*(a*cos[c + d*x] + b*sin[c +
 d*x])^p, x], x] /; FreeQ[{a, b, c, d, m, n}, x] && IGtQ[p, 0]

Rule 3187

Int[cos[(c_.) + (d_.)*(x_)]^(m_.)*sin[(c_.) + (d_.)*(x_)]^(n_.)*(cos[(c_.) + (d_.)*(x_)]*(a_.) + (b_.)*sin[(c_
.) + (d_.)*(x_)])^(p_), x_Symbol] :> Dist[a^p*b^p, Int[(Cos[c + d*x]^m*Sin[c + d*x]^n)/(b*Cos[c + d*x] + a*Sin
[c + d*x])^p, x], x] /; FreeQ[{a, b, c, d, m, n}, x] && EqQ[a^2 + b^2, 0] && ILtQ[p, 0]

Rule 3599

Int[sin[(e_.) + (f_.)*(x_)]^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Int[Sin[e + f*x]^
m*((a*Cos[e + f*x] + b*Sin[e + f*x])^n/Cos[e + f*x]^n), x] /; FreeQ[{a, b, e, f}, x] && IntegerQ[(m - 1)/2] &&
 ILtQ[n, 0] && ((LtQ[m, 5] && GtQ[n, -4]) || (EqQ[m, 5] && EqQ[n, -1]))

Rule 3853

Int[(csc[(c_.) + (d_.)*(x_)]*(b_.))^(n_), x_Symbol] :> Simp[(-b)*Cos[c + d*x]*((b*Csc[c + d*x])^(n - 1)/(d*(n
- 1))), x] + Dist[b^2*((n - 2)/(n - 1)), Int[(b*Csc[c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n,
 1] && IntegerQ[2*n]

Rule 3855

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]

Rubi steps \begin{align*} \text {integral}& = \int \frac {\cot (x) \csc ^4(x)}{i \cos (x)+\sin (x)} \, dx \\ & = -\left (i \int \cot (x) \csc ^4(x) (\cos (x)+i \sin (x)) \, dx\right ) \\ & = -\left (i \int \left (i \cot (x) \csc ^3(x)+\cot ^2(x) \csc ^3(x)\right ) \, dx\right ) \\ & = -\left (i \int \cot ^2(x) \csc ^3(x) \, dx\right )+\int \cot (x) \csc ^3(x) \, dx \\ & = \frac {1}{4} i \cot (x) \csc ^3(x)+\frac {1}{4} i \int \csc ^3(x) \, dx-\text {Subst}\left (\int x^2 \, dx,x,\csc (x)\right ) \\ & = -\frac {1}{8} i \cot (x) \csc (x)-\frac {\csc ^3(x)}{3}+\frac {1}{4} i \cot (x) \csc ^3(x)+\frac {1}{8} i \int \csc (x) \, dx \\ & = -\frac {1}{8} i \text {arctanh}(\cos (x))-\frac {1}{8} i \cot (x) \csc (x)-\frac {\csc ^3(x)}{3}+\frac {1}{4} i \cot (x) \csc ^3(x) \\ \end{align*}

Mathematica [B] (verified)

Both result and optimal contain complex but leaf count is larger than twice the leaf count of optimal. \(139\) vs. \(2(40)=80\).

Time = 0.04 (sec) , antiderivative size = 139, normalized size of antiderivative = 3.48 \[ \int \frac {\csc ^5(x)}{i+\tan (x)} \, dx=-\frac {1}{12} \cot \left (\frac {x}{2}\right )-\frac {1}{32} i \csc ^2\left (\frac {x}{2}\right )-\frac {1}{24} \cot \left (\frac {x}{2}\right ) \csc ^2\left (\frac {x}{2}\right )+\frac {1}{64} i \csc ^4\left (\frac {x}{2}\right )-\frac {1}{8} i \log \left (\cos \left (\frac {x}{2}\right )\right )+\frac {1}{8} i \log \left (\sin \left (\frac {x}{2}\right )\right )+\frac {1}{32} i \sec ^2\left (\frac {x}{2}\right )-\frac {1}{64} i \sec ^4\left (\frac {x}{2}\right )-\frac {1}{12} \tan \left (\frac {x}{2}\right )-\frac {1}{24} \sec ^2\left (\frac {x}{2}\right ) \tan \left (\frac {x}{2}\right ) \]

[In]

Integrate[Csc[x]^5/(I + Tan[x]),x]

[Out]

-1/12*Cot[x/2] - (I/32)*Csc[x/2]^2 - (Cot[x/2]*Csc[x/2]^2)/24 + (I/64)*Csc[x/2]^4 - (I/8)*Log[Cos[x/2]] + (I/8
)*Log[Sin[x/2]] + (I/32)*Sec[x/2]^2 - (I/64)*Sec[x/2]^4 - Tan[x/2]/12 - (Sec[x/2]^2*Tan[x/2])/24

Maple [A] (verified)

Time = 131.16 (sec) , antiderivative size = 58, normalized size of antiderivative = 1.45

method result size
default \(-\frac {\tan \left (\frac {x}{2}\right )}{8}-\frac {i \left (\tan ^{4}\left (\frac {x}{2}\right )\right )}{64}-\frac {\left (\tan ^{3}\left (\frac {x}{2}\right )\right )}{24}+\frac {i}{64 \tan \left (\frac {x}{2}\right )^{4}}-\frac {1}{24 \tan \left (\frac {x}{2}\right )^{3}}+\frac {i \ln \left (\tan \left (\frac {x}{2}\right )\right )}{8}-\frac {1}{8 \tan \left (\frac {x}{2}\right )}\) \(58\)
risch \(\frac {i \left (3 \,{\mathrm e}^{7 i x}+53 \,{\mathrm e}^{5 i x}-11 \,{\mathrm e}^{3 i x}+3 \,{\mathrm e}^{i x}\right )}{12 \left ({\mathrm e}^{2 i x}-1\right )^{4}}+\frac {i \ln \left ({\mathrm e}^{i x}-1\right )}{8}-\frac {i \ln \left ({\mathrm e}^{i x}+1\right )}{8}\) \(65\)

[In]

int(csc(x)^5/(I+tan(x)),x,method=_RETURNVERBOSE)

[Out]

-1/8*tan(1/2*x)-1/64*I*tan(1/2*x)^4-1/24*tan(1/2*x)^3+1/64*I/tan(1/2*x)^4-1/24/tan(1/2*x)^3+1/8*I*ln(tan(1/2*x
))-1/8/tan(1/2*x)

Fricas [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 123 vs. \(2 (26) = 52\).

Time = 0.25 (sec) , antiderivative size = 123, normalized size of antiderivative = 3.08 \[ \int \frac {\csc ^5(x)}{i+\tan (x)} \, dx=-\frac {3 \, {\left (i \, e^{\left (8 i \, x\right )} - 4 i \, e^{\left (6 i \, x\right )} + 6 i \, e^{\left (4 i \, x\right )} - 4 i \, e^{\left (2 i \, x\right )} + i\right )} \log \left (e^{\left (i \, x\right )} + 1\right ) + 3 \, {\left (-i \, e^{\left (8 i \, x\right )} + 4 i \, e^{\left (6 i \, x\right )} - 6 i \, e^{\left (4 i \, x\right )} + 4 i \, e^{\left (2 i \, x\right )} - i\right )} \log \left (e^{\left (i \, x\right )} - 1\right ) - 6 i \, e^{\left (7 i \, x\right )} - 106 i \, e^{\left (5 i \, x\right )} + 22 i \, e^{\left (3 i \, x\right )} - 6 i \, e^{\left (i \, x\right )}}{24 \, {\left (e^{\left (8 i \, x\right )} - 4 \, e^{\left (6 i \, x\right )} + 6 \, e^{\left (4 i \, x\right )} - 4 \, e^{\left (2 i \, x\right )} + 1\right )}} \]

[In]

integrate(csc(x)^5/(I+tan(x)),x, algorithm="fricas")

[Out]

-1/24*(3*(I*e^(8*I*x) - 4*I*e^(6*I*x) + 6*I*e^(4*I*x) - 4*I*e^(2*I*x) + I)*log(e^(I*x) + 1) + 3*(-I*e^(8*I*x)
+ 4*I*e^(6*I*x) - 6*I*e^(4*I*x) + 4*I*e^(2*I*x) - I)*log(e^(I*x) - 1) - 6*I*e^(7*I*x) - 106*I*e^(5*I*x) + 22*I
*e^(3*I*x) - 6*I*e^(I*x))/(e^(8*I*x) - 4*e^(6*I*x) + 6*e^(4*I*x) - 4*e^(2*I*x) + 1)

Sympy [F]

\[ \int \frac {\csc ^5(x)}{i+\tan (x)} \, dx=\int \frac {\csc ^{5}{\left (x \right )}}{\tan {\left (x \right )} + i}\, dx \]

[In]

integrate(csc(x)**5/(I+tan(x)),x)

[Out]

Integral(csc(x)**5/(tan(x) + I), x)

Maxima [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 83 vs. \(2 (26) = 52\).

Time = 0.21 (sec) , antiderivative size = 83, normalized size of antiderivative = 2.08 \[ \int \frac {\csc ^5(x)}{i+\tan (x)} \, dx=-\frac {{\left (\frac {8 \, \sin \left (x\right )}{\cos \left (x\right ) + 1} + \frac {24 \, \sin \left (x\right )^{3}}{{\left (\cos \left (x\right ) + 1\right )}^{3}} - 3 i\right )} {\left (\cos \left (x\right ) + 1\right )}^{4}}{192 \, \sin \left (x\right )^{4}} - \frac {\sin \left (x\right )}{8 \, {\left (\cos \left (x\right ) + 1\right )}} - \frac {\sin \left (x\right )^{3}}{24 \, {\left (\cos \left (x\right ) + 1\right )}^{3}} - \frac {i \, \sin \left (x\right )^{4}}{64 \, {\left (\cos \left (x\right ) + 1\right )}^{4}} + \frac {1}{8} i \, \log \left (\frac {\sin \left (x\right )}{\cos \left (x\right ) + 1}\right ) \]

[In]

integrate(csc(x)^5/(I+tan(x)),x, algorithm="maxima")

[Out]

-1/192*(8*sin(x)/(cos(x) + 1) + 24*sin(x)^3/(cos(x) + 1)^3 - 3*I)*(cos(x) + 1)^4/sin(x)^4 - 1/8*sin(x)/(cos(x)
 + 1) - 1/24*sin(x)^3/(cos(x) + 1)^3 - 1/64*I*sin(x)^4/(cos(x) + 1)^4 + 1/8*I*log(sin(x)/(cos(x) + 1))

Giac [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 62 vs. \(2 (26) = 52\).

Time = 0.33 (sec) , antiderivative size = 62, normalized size of antiderivative = 1.55 \[ \int \frac {\csc ^5(x)}{i+\tan (x)} \, dx=-\frac {1}{64} i \, \tan \left (\frac {1}{2} \, x\right )^{4} - \frac {1}{24} \, \tan \left (\frac {1}{2} \, x\right )^{3} - \frac {50 i \, \tan \left (\frac {1}{2} \, x\right )^{4} + 24 \, \tan \left (\frac {1}{2} \, x\right )^{3} + 8 \, \tan \left (\frac {1}{2} \, x\right ) - 3 i}{192 \, \tan \left (\frac {1}{2} \, x\right )^{4}} + \frac {1}{8} i \, \log \left (\tan \left (\frac {1}{2} \, x\right )\right ) - \frac {1}{8} \, \tan \left (\frac {1}{2} \, x\right ) \]

[In]

integrate(csc(x)^5/(I+tan(x)),x, algorithm="giac")

[Out]

-1/64*I*tan(1/2*x)^4 - 1/24*tan(1/2*x)^3 - 1/192*(50*I*tan(1/2*x)^4 + 24*tan(1/2*x)^3 + 8*tan(1/2*x) - 3*I)/ta
n(1/2*x)^4 + 1/8*I*log(tan(1/2*x)) - 1/8*tan(1/2*x)

Mupad [B] (verification not implemented)

Time = 5.00 (sec) , antiderivative size = 57, normalized size of antiderivative = 1.42 \[ \int \frac {\csc ^5(x)}{i+\tan (x)} \, dx=-\frac {\mathrm {tan}\left (\frac {x}{2}\right )}{8}+\frac {\ln \left (\mathrm {tan}\left (\frac {x}{2}\right )\right )\,1{}\mathrm {i}}{8}-\frac {2\,{\mathrm {tan}\left (\frac {x}{2}\right )}^3+\frac {2\,\mathrm {tan}\left (\frac {x}{2}\right )}{3}-\frac {1}{4}{}\mathrm {i}}{16\,{\mathrm {tan}\left (\frac {x}{2}\right )}^4}-\frac {{\mathrm {tan}\left (\frac {x}{2}\right )}^3}{24}-\frac {{\mathrm {tan}\left (\frac {x}{2}\right )}^4\,1{}\mathrm {i}}{64} \]

[In]

int(1/(sin(x)^5*(tan(x) + 1i)),x)

[Out]

(log(tan(x/2))*1i)/8 - tan(x/2)/8 - ((2*tan(x/2))/3 + 2*tan(x/2)^3 - 1i/4)/(16*tan(x/2)^4) - tan(x/2)^3/24 - (
tan(x/2)^4*1i)/64